import Router from "koa-router";
import { auth, isAdmin } from "../middleware/auth.middleware.js";
import { productVerification } from "../middleware/goods.midleware.js";
import {
  uploadGoods,
  createdGoods,
  updateGoods,
  getGoodsList,
  deleteGoods,
} from "../controller/goods.controller.js";

const router = new Router({ prefix: "/goods" });

router.get("/list", auth, isAdmin, getGoodsList);
// router.post("/upload", auth, isAdmin, uploadGoods);
router.post("/upload", auth, isAdmin, uploadGoods);
router.post("/add", auth, isAdmin, productVerification, createdGoods);
router.put("/update/:id", auth, isAdmin, productVerification, updateGoods);
router.delete("/delete/:id", auth, isAdmin, deleteGoods);

export default router;
